Skip to content

Conversation

@mcasimir
Copy link
Collaborator

refactor: remove ampersand-view dependency and update renderer process startup structure

  • Removed references to ampersand-view from package.json and package-lock.json.
  • Updated entry point in webpack.config.js to use index.ts instead of index.tsx.
  • Cleaned up type definitions by removing the ampersand-view module declaration.
  • Refactored setup-hadron-distribution.ts to improve clarity and organization.
  • Introduced a new application.tsx file to manage application lifecycle and rendering.
  • Added global error handling and DNS configuration in index.ts.
  • Removed obsolete menu-renderer.js file.
  • Migrated stateful imports to regular exported functions (eg. CSP in csp.ts).

mcasimir added 2 commits May 15, 2025 17:24
…s startup structure

- Removed references to `ampersand-view` from `package.json` and `package-lock.json`.
- Updated entry point in `webpack.config.js` to use `index.ts` instead of `index.tsx`.
- Cleaned up type definitions by removing the `ampersand-view` module declaration.
- Refactored `setup-hadron-distribution.ts` to improve clarity and organization.
- Introduced a new `application.tsx` file to manage application lifecycle and rendering.
- Added global error handling and DNS configuration in `index.ts`.
- Removed obsolete `menu-renderer.js` file.
- Migrated stateful imports to regular exported functions (eg. CSP in `csp.ts`).
@mcasimir mcasimir requested a review from Copilot May 15, 2025 15:38
@mcasimir mcasimir added the no-title-validation Skips validation of PR titles (conventional commit adherence + JIRA ticket inclusion) label May 15, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the renderer initialization by removing the ampersand‑view dependency and improving the application startup structure. Key changes include updating the webpack entry point, refactoring the Hadron distribution setup with enhanced documentation, and migrating stateful imports to regular exported functions.

Reviewed Changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated no comments.

Show a summary per file
File Description
packages/compass/webpack.config.js Updated the entry point from index.tsx to index.ts
packages/compass/src/setup-hadron-distribution.ts Added a JSDoc comment and reformatted environment variable setup
packages/compass/src/main/index.ts Changed to an import-based setup for Hadron distribution
packages/compass/src/app/utils/csp.ts Converted injectCSP to an exported function and removed auto-run call
packages/compass/src/app/menu-renderer.js Removed obsolete file
packages/compass/src/app/index.ts Introduced new lifecycle initialization code
packages/compass/package.json Removed ampersand‑view dependency
Comments suppressed due to low confidence (2)

packages/compass/src/setup-hadron-distribution.ts:13

  • Typo in the comment on line 13: 'durng' should be 'during'.
* All these variables below are used by Compass and its plugins in one way or

packages/compass/src/app/utils/csp.ts:107

  • The previous auto-invocation of injectCSP() has been removed. Ensure that this function is explicitly called where needed to maintain CSP injection.
injectCSP();

@mcasimir mcasimir added the no release notes Fix or feature not for release notes label May 15, 2025
Comment on lines 457 to 458
// Inject CSP first to prevent any CSP violations.
injectCSP();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it might be worth to still have this at the very top near "setup hadron" before any imports to make sure that csp applies to as much code that executes as possible

Copy link
Collaborator

@gribnoysup gribnoysup left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! One suggestion to move csp injection back to the very top

@mcasimir mcasimir merged commit 39c08b2 into main May 27, 2025
53 of 55 checks passed
@mcasimir mcasimir deleted the refactor-renderer-init branch May 27, 2025 10:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no release notes Fix or feature not for release notes no-title-validation Skips validation of PR titles (conventional commit adherence + JIRA ticket inclusion)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants